import type { Theme } from 'vitepress';
import DefaultTheme from "vitepress/theme";
import type { App } from 'vue';
import FoffUI from "@foff-ui/components";
import '@foff-ui/theme-chalk/index.less';
import './index.css'
import Preview from './Preview.vue';
import ApiDocs from './ApiDocs.vue';
import "highlight.js/styles/base16/summerfruit-light.css"; // 主题

import hljsVuePlugin from "@highlightjs/vue-plugin";

const theme: Theme = {
    ...DefaultTheme,
    enhanceApp: async ({ app, router, siteData }: { 
        app: App; 
        router: any;
        siteData: any; 
    }) => {
        app.use(FoffUI);
        app.component('Preview', Preview);
        app.component('ApiDocs', ApiDocs);
        app.use(hljsVuePlugin);
    },
};

export default theme;
